package top.javawa.message.web;

import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author aaron
 */
@Log
@RestController
@RequestMapping("/message")
public class MessageController {
  @Autowired
  private RestTemplate restTemplate;

  /**
   * getTokens
   *
   * @return application/json
   */
  @GetMapping("/tokens")
  public String getAllToken() {
    return restTemplate.getForObject("http://token-service/token/all",String.class);
  }
}
